<#import "../tpl/pageTep.ftl" as page>
<@page.pageBase currentMenu="提现明细">
<style>
    .form-horizontal .controls {
        line-height: 40px;
        height: 40px;
    }

    .span16 {
        width: 880px;
    }

    .form-horizontal .time-label {
        width: 60px;
        line-height: 40px;
        margin-left: 20px;
    }

    .button-primary {
        margin-left: 5px;
    }

    .form-panel .time-input {
        width: 120px;
    }

    .form-panel select {
        margin-left: 10px;
    }

    .form-horizontal .time-controls {
        margin-left: 5px;
    }
</style>
<form id="searchForm" class="form-panel" action="${basepath}/manage/fund/loadData">

    <ul class="panel-content">
        <li>
            <div>
                <div class="control-group span5">
                    <div class="search-controls  controls">
                        <input type="text" name="payee" id="title" value="" placeholder="搜索关键字">
                    </div>
                </div>
                <div class="form-actions span2">
                    <button type="submit" class="button  button-primary">
                        搜索
                    </button>
                </div>
            </div>
            <div>
                <label class="time-label control-label">申请日期：</label>

                <div class="time-controls controls">
                    <input name="startDate" class="input-small calendar" type="text" style="width: 80px;"><label>&nbsp;-&nbsp;</label><input
                        name="endDate" class="input-small calendar" type="text" style="width: 80px;">
                </div>
                <select name="status" class="input-normal" id="status">
                    <option value="">状态</option>
                    <option value="1">待审核</option>
                    <option value="2">通过</option>
                    <option value="3">不通过</option>
                </select>
                <button type="submit" class="query-button button button-primary">
                    查询
                </button>
            </div>
        </li>
    </ul>
</form>
<div id="grid"></div>
<script>
    /*-------------------------------------------------------- 表格数据渲染start-----------------------------------*/
    var Grid = BUI.Grid,
            Store = BUI.Data.Store,
            columns = [
                {title: '序号', dataIndex: 'id', elCls: 'center', width: '9%'},
                {title: '申请日期', dataIndex: 'applyDate', elCls: 'center', width: '13%'},
                {title: '申请人', dataIndex: 'applicant', elCls: 'center', width: '13%'},
                {title: '收款人', dataIndex: 'payee', elCls: 'center', width: '13%'},

                {
                    title: '帐号类型', dataIndex: 'accountType', elCls: 'center', width: '13%',
                    renderer: function (data) {
                        if (data == "1") {
                            return '支付宝';
                        }
                        if (data == "2") {
                            return '微信';
                        } else {
                            return '银行卡';
                        }
                    }
                },
                {title: '收款账号', dataIndex: 'payAccount', elCls: 'center', width: '13%'},
                {title: '提现金额', dataIndex: 'money', elCls: 'center', width: '13%'},
                {
                    title: '状态', dataIndex: 'status', elCls: 'center', width: '13%',
                    renderer: function (data) {
                        if (data == "1") {
                            return '待审核';
                        }
                        if (data == "2") {
                            return '已通过';
                        } else {
                            return '不通过';
                        }
                    }
                }
            ];
    var store = new Store({
                url: 'loadData',
                autoLoad: true, //自动加载数据
                params: { //配置初始请求的参数
                    length: '10',
                    status: $("#phone").val(),
                    organizeID: sessionStorage.id
                },
                pageSize: 10,	// 配置分页数目
                root: 'list',
                totalProperty: 'total'
            }),
            grid = new Grid.Grid({
                render: '#grid',
                columns: columns,
                loadMask: true, //加载数据时显示屏蔽层
                store: store,
                plugins: [Grid.Plugins.CheckSelection], // 插件形式引入多选表格

                // 底部工具栏
                bbar: {
                    pagingBar: true
                }
            });
    grid.render();

    var form = new BUI.Form.HForm({
        srcNode: '#searchForm'
    }).render();

    form.on('beforesubmit', function (ev) {
        //序列化成对象
        var obj = form.serializeToObject();
        obj.start = 0; //返回第一页
        store.load(obj);
        return false;
    });
    /*-------------------------------------------------------- 表格数据渲染end-----------------------------------*/

</script>
</@page.pageBase>